package com.techsoul.module.pms.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.techsoul.common.core.pojo.vo.UserVo;
import com.techsoul.module.basic.pojo.entity.CustomerConsignee;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialDelivery;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialDeliveryLine;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialDeliveryLineSaveParam;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialDeliverySaveParam;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialDeliverySearchParam;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialReceiptSaveParam;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialDeliveryVo;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 出库单 Service接口
 * 
 * @author liuen
 * @date 2022-01-25
 */
public interface ITbWmsMaterialDeliveryService {

    /**
     * 新增
     * @param params
     * @return
     */
    String insert(TbWmsMaterialDeliverySaveParam params);

    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 批量删除
     * @param idList
     */
    Integer batchDelete(List<String> idList);

    /**
     * 修改
     * @param params
     * @return
     */
    Integer update(TbWmsMaterialDeliverySaveParam params);

    /**
     * 详情
     * @param id
     * @return
     */
    TbWmsMaterialDeliveryVo findById(String id);
    TbWmsMaterialDeliveryVo getOrderDetail(String id);


    TbWmsMaterialDeliveryVo findByOrderNo(String orderNo);

    /**
     * 列表
     * @param params
     * @return
     */
    List<TbWmsMaterialDeliveryVo> findAll(TbWmsMaterialDeliverySearchParam params);

    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<TbWmsMaterialDeliveryVo> findAll(TbWmsMaterialDeliverySearchParam params, Integer current, Integer pageSize);

    String importTemplate();
    CustomerConsignee generateConsigneeId(TbWmsMaterialDeliverySaveParam params, String userId, String customerNo);
    String importData(MultipartFile file, boolean isUpdateSupport);
    String generateCustomer(TbWmsMaterialDeliverySaveParam params,String userId);
    String insertItem(TbWmsMaterialDeliverySaveParam params, String userId);
    String insertALLItem(TbWmsMaterialDeliverySaveParam params);
    List<TbWmsMaterialDeliveryLine> insertALLToolsItem(TbWmsMaterialDeliverySaveParam params);
    List<TbWmsMaterialDeliveryLine> insertToolsItem(TbWmsMaterialDeliverySaveParam deliverySaveParam,String deliveryId, UserVo sysUser,String templateId);
     void findByDateAndShipperAndUpdateCalendar(TbWmsMaterialDelivery order, String custNo, UserVo user);

}
